<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>

        function getsum(arr) {
            let sum = 0
            for (let i = 0; i < arr.length; i++) {
                sum += arr[i]
            }
            document.write(sum)
        }
        let arr = []
        let j
        while (true) {
            let j = +prompt(`请输入各科成绩并按00结束`)
            if (j !== 00) {
                arr.push(j)
            }
            else {
                break
            }
        }
        getsum(arr)

    </script>
</body>

</html>